package com.sim.contact.tool.contacts;

import android.provider.ContactsContract;

public class IM {
    private String name;
     private int type;
     public String getName() {
         return name;
     }
     public void setName(String name) {
         this.name = name;
     }
     public int getType() {
         return type;
     }
     public void setType(int type) {
         this.type = type;
     }
     
     public IM(String name, int type) {
         this.name = name;
         this.type = type;
     }
     
     /**
      * format 个人,xxx@xxx.com
      * @return
      */
     public String toString(){
     	String rslt="";
     	rslt+=getTypeName();
 		rslt+=":";
 		rslt+=(name==null?"":name);
     	
     	return rslt; 
     }
     
     private String getTypeName(){
     	String name="";
     	switch (type) {
 		case ContactsContract.CommonDataKinds.Im.TYPE_WORK:
 			name = "工作IM";
 			break;
 		case ContactsContract.CommonDataKinds.Im.TYPE_HOME:
 			name = "个人IM";
 			break;
 		default:
 			name = "其他IM";
 			break;
 		}
     	
     	return name;
     }
}